<?php


use Doraemon\tools\Log;
use Doraemon\model\Blank;
use Doraemon\model\Guide;
use Doraemon\model\Photos;
use Doraemon\model\Comment;
use Doraemon\model\Article;
use Doraemon\model\IdeaBook;
use Biz\model\Album\AlbumListModel;

class CloseUserThingAction extends ActionPlugin
{
    /**
     * @throws Exception
     */
    public function main()
    {
        Log::info('注销、封禁收到事件信息', $this->messageBody);
        $uid = $this->messageBody['data']['uid'] ?? 0;
        //删除用户所有评论
        Comment::delCommentByUid($uid);

        //删除用户所有生产内容  photos blank article guide album IdeaBook
        Photos::delByUid($uid);
        Blank::delByUid($uid);
        Article::delByUid($uid);
        Guide::delByUid($uid);
        AlbumListModel::delByUid($uid);
        IdeaBook::delByUid($uid);
        $this->setSuccess(['message' =>'success']);
    }
}